<script>
	import {
		rear
	} from '@/config/api.js';
	export default {
		onLaunch() {
			if (uni.getStorageSync('user') != null && uni.getStorageSync('user') != '') {
				uni.request({
					url: rear + "/user/loginStatus", // API 地址,
					method: 'POST',
					data: {
						"id": uni.getStorageSync('user').id,
						"secret": uni.getStorageSync('user').secret
					},
					success: (res) => {
						uni.removeStorageSync('user');
						if (res.data.data == null) {
							uni.showToast({
								title: "登录状态过期",
								icon: 'none',
								duration: 2000,
							})
						} else {
							uni.setStorageSync('user', res.data.data);
						}
					}
				})
			}


		}
	}
</script>

<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
	/*每个页面公共css */
</style>